/* left-box1 */
let leftBox1Rom = document.getElementById('left-box1')
let leftBox1MyChart = echarts.init(leftBox1Rom);
let leftBox1Option;

leftBox1Option = {
    color: ['#80FFA5'],
    title: {
        show: true,
        text: "公共图书馆总藏书量变化(万册)",
        textStyle: {
            color: '#fff',
            fontFamily: '楷体',
            fontSize: '1.3rem',
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross',
            label: {
                backgroundColor: '#6a7985'
            }
        },
        formatter: function (data) {
            // console.log(data);
            return data[0].name + ": " + data[0].value + "万册";
        },
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [
        {
            type: 'category',
            boundaryGap: false,
            data: ['2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020'],
            axisLabel: {
                color: '#fff',
                fontSize: 10,
            },
        }
    ],
    yAxis: [
        {
            type: 'value',
            axisLabel: {
                color: '#fff',
                fontSize: 10,
            },
            scale: true
        }
    ],
    series: [
        {
            name: 'Line 5',
            type: 'line',
            stack: 'Total',
            smooth: true,
            lineStyle: {
                width: 0
            },
            showSymbol: false,
            label: {
                show: true,
                position: 'top'
            },
            areaStyle: {
                opacity: 0.8,
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                    {
                        offset: 0,
                        color: 'rgb(255, 191, 0)'
                    },
                    {
                        offset: 1,
                        color: 'rgb(224, 62, 76)'
                    }
                ])
            },
            emphasis: {
                focus: 'series'
            },
            data: [78852, 74896, 79092, 83844, 90163, 96953, 103716, 111181, 117930,]
        }
    ]
};

leftBox1Option && leftBox1MyChart.setOption(leftBox1Option);

window.onresize = function () {
    leftBox1MyChart.resize();
};
/* left-box2 */
let leftBox2Rom = document.getElementById('left-box2')
let leftBox2MyChart = echarts.init(leftBox2Rom);
let leftBox2Option;

const pathSymbols = {
    book: 'path://M962.272 376.8c-2.752-1.696-5.632-3.464-8.68-4.36-8.08-2.4-9.232-8.104-8.24-15.24 0.56-4 0.4-8.216 1.44-12.08 3.656-13.616 2.184-27.488 2.68-41.264 0.24-6.88-2.4-12.16-7.472-17.152-9.552-9.424-20.68-15.104-33.616-18.08-30.936-7.152-62.48-10.32-93.92-13.52-40.64-4.136-81.312-0.496-121.504 5.2-41.12 5.808-80.72 18-117.872 37.216-5.056 2.6-10.272 4.848-15.416 7.256-6.504 3.056-12.768 2.048-18.56-1.648-3.36-2.16-6.688-4.72-9.4-7.64-16.064-17.52-35.136-31.264-54.696-44.528-26.36-17.888-53.36-34.056-84.696-41.864-8.608-2.16-17.04-5.4-25.28-8.8-21.472-8.864-43.76-11.84-66.8-10.456-5.68 0.336-11.392 0.536-17.064 0.8-7.336 0-14.68 0.264-21.968-0.048-18.816-0.8-37.24 1.92-55.68 5.184-9.36 1.68-14.24 7.232-16.24 15.84-0.92 3.92-1.2 8.04-1.496 12.064-0.272 4.08-0.024 8.16-0.256 12.2-0.48 8.424-2.84 12.032-12.056 11.56-12.96-0.64-16.96 6.52-19.344 16.896-5.44 23.72-11.72 47.28-16.384 71.12a1512.256 1512.256 0 0 0-13.632 81.552c-7.84 56.32-21.36 111.504-32.448 167.144a9939.68 9939.68 0 0 1-20.4 100.08c-2.04 9.816-0.144 18 8.352 23.416 3.92 2.48 9.024 3.896 13.728 4.32 21.016 1.76 42.096 4.296 63.12 4.136 31.072-0.24 61.6 4.52 92.192 7.984 38.776 4.44 77.376 9.44 116.464 9.504 6.48 0.024 13.088-0.08 19.408 1.12 26.144 4.904 24.896 4.656 30.272 27.624 0.16 0.8 0.36 1.624 0.464 2.4 1.04 8.68 5.72 15.36 12.8 19.84 9.584 6.048 19.28 12.176 29.6 16.768 14.944 6.656 30.504 11.08 47.216 5.44 4.496-1.52 9.744-0.696 14.48-1.76 15.064-3.408 30.44-6.32 41.648-18.36 5.136-5.488 11.472-5.576 18.032-4.72 3.176 0.448 6.256 1.68 9.384 2.536 37.648 10.36 76.24 15.52 114.704 21.632 22.32 3.568 45.224 4.936 66.8 12.816 2.28 0.8 4.776 1.184 7.168 1.336 19.544 1.136 38.544 4.912 57.616 9.184 26.344 5.888 30.88 2.64 38.528-22.6 0.72-2.304 1.12-4.736 1.712-7.104 8.208-33.024 16.56-66.048 24.664-99.16 2.08-8.64 3.336-17.496 5.04-26.24 3.656-19.12 6.56-38.4 11.248-57.256 18.032-72.416 33.152-145.496 49.168-218.368 0.68-3.136 1.32-6.376 1.44-9.56 0.176-5.168-1.72-9.6-6.256-12.4zM143.44 609.712c2.784-2.528 6.816-4.576 10.504-4.976 7.2-0.736 14.56-0.208 20.12-0.208 27.816-0.208 52.936 6.16 78.128 11.864 0.704 0.16 1.264 0.96 1.896 1.488-1.04 0.856-2.12 2.48-3.144 2.448-12.928-0.344-25.976 0-38.696-1.84-8.2-1.168-15.776-0.848-23.872 0.176-13.6 1.76-27.424 2-41.16 2.504-2.032 0.064-5.76-1.792-5.888-3.04-0.288-2.8 0.304-6.72 2.16-8.424z m224 77.784c-24.496-5.48-49.232-10.136-73.376-17.024-30.576-8.72-61.296-15.28-93.2-16.08-9.68-0.272-19.36-1.808-28.944-3.44-5.072-0.88-9.56-0.688-14.104 1.68-3.6 1.84-7.488 3.28-8.04 8.112-0.424 3.856 3.904 7.256 10.288 8.04 28.184 3.36 56.4 6.664 84.592 10.16 4.8 0.608 9.56 1.84 14.24 3.04 22.024 5.584 44.04 11.2 65.968 16.984 3.104 0.824 6 2.416 8.848 3.952 1.24 0.664 2.096 2.032 3.12 3.072-1.544 0.4-3.12 0.864-4.704 1.184-0.768 0.16-1.6 0.144-4.96 0.344-11.936-1.952-26.296-4.56-40.72-6.56-20.08-2.816-40.24-5.04-60.32-7.784-18.464-2.52-36.944-5.056-55.28-8.32-7.888-1.4-15.416-4.752-23.176-7.04-5.36-1.568-10.856-2.72-16.208-4.344-2.288-0.68-4.416-1.944-3.312-5.144 2.688-7.72-0.848-14.24-4.112-20.84a67.096 67.096 0 0 1-4.496-11.008c-0.296-1.04 1.12-3.08 2.304-3.92 1.04-0.88 3.024-1.312 4.208-0.904 1.344 0.512 2.576 2 3.304 3.36 3.488 6.52 9.44 8.84 16.16 9.144 12.96 0.536 26.032 1.28 39.008 0.864 26.96-0.896 53.336 3.216 79.856 7.36 19.28 3.04 38.56 5.896 57.088 11.896 16.144 5.232 31.792 11.984 47.616 18.24 1.24 0.48 1.92 2.384 2.84 3.6-1.496 0.504-3.168 1.68-4.48 1.376z m29.296-41.744c-47.704-27.168-99.92-42.04-152.8-54.744-26.016-6.272-52.424-10.752-79.4-10.28-7.256 0.136-10.584-3.888-9.12-10.88 4.752-23.008 9.336-46.08 15.008-68.856 12.16-48.8 21.248-98.16 28.176-147.944 1.216-8.744 2.928-17.864 6.656-25.76 6.432-13.68 8.36-27.856 8.48-42.576 0.104-18.672 0-37.36 0.2-56.048 0.04-6.56 2.944-9.304 8.816-8.296 25.808 4.496 51.56 4.352 77.552 1.408 13.784-1.552 27.48 1.52 40.64 5.984 20.704 7.064 41.728 13.408 61.864 21.92 23.16 9.808 45.28 21.624 63.392 40.032 10.776 10.928 23.328 20.112 35.104 30.048 3.144 2.6 6.56 4.84 9.648 7.472 13.48 11.52 23.776 24.56 20.88 44.104-2.4 16-4.752 32.032-7.28 48.04-2.664 16.8-5.488 33.56-8.296 50.344-1.88 11.168-3.2 22.48-5.784 33.48-11.144 47.312-22.672 94.536-34.08 141.784-0.56 2.368-1.184 4.736-1.936 7.04-3.28 9.952-6.64 19.84-9.952 29.776-12.448-1.12-22.24-8.4-32.48-14.424-11.88-6.944-23.28-14.76-35.248-21.616z m83.328 59.04v1.44c-1-0.264-1.96-0.56-2.96-0.848 0.536-0.424 1-1.08 1.6-1.28 0.36-0.136 0.96 0.424 1.36 0.68z m56 62.192c-13.968 10.64-30.016 15.2-49.064 14.976-10.496 1.28-20.64-2.72-29.248-11.12-4.64-4.52-9.256-9.064-13.96-13.48-5.92-5.536-7.144-12.448-6-20 0.224-1.408 1.808-3.84 2.48-3.736 2.16 0.32 5.68 1.2 6.048 2.56 5.704 21.976 22.6 30.464 42.368 34.624 12.88 2.72 25.904 2.912 35.496-9.16a9.52 9.52 0 0 1 6.192-3.2c2.064-0.128 4.896 1.088 6.12 2.68 0.936 1.224 0.656 5.008-0.448 5.864z m7.616-25.888c-2.64 0.4-5.36 0.528-8.04 0.72-0.08 0.256-0.24 0.448-0.28 0.768-0.616-0.016-1.248-0.056-1.88-0.08-9.616 5.024-23.008 8.76-29.584 8.04-0.576-0.08-1.576-0.864-1.536-1.184 0.08-0.72 0.576-1.664 1.2-2 3.408-1.88 6.776-4.816 10.36-5.152 6.464-0.6 13.04 0.016 19.568 0.288 0.4-0.208 0.856-0.4 1.24-0.624l0.936-0.056c0.92-2.992 3.456-3.712 6.28-3.728 1.376 0 2.8 0.704 4.208 1.088-0.8 0.656-1.552 1.76-2.432 1.92z m17.2-5.76a4.64 4.64 0 0 1-2.016 0.176c-0.64-0.136-1.16-0.64-1.744-0.984h3.952c-0.048 0.24-0.064 0.768-0.2 0.8z m16.96-4.416c-0.56 0.064-1.232-0.68-1.84-1.056 1.392-0.36 2.76-0.88 4.16-1.008 0.56-0.08 1.2 0.68 1.792 1.04-1.344 0.344-2.704 0.88-4.096 1.024z m15.568-3.8c-0.616 0.08-1.44-0.72-2-1.28-0.136-0.128 0.264-1.2 0.64-1.376a26.16 26.16 0 0 1 4.4-1.76c24.944-7.144 50.32-11.488 76.4-12.064 12.08 0.864 24.136 1.664 36.192 2.672 1.504 0.136 2.904 1.28 4.352 1.96-1.44 0.616-2.84 1.624-4.352 1.84-3.184 0.48-6.416 0.52-9.64 0.76-24.96 1.808-49.944 3.44-74.88 5.488-10.384 0.832-20.72 2.544-31.104 3.744z m258.264 33.4a5481.328 5481.328 0 0 1-10.32 26.92c-9.6 2.616-18.936-0.72-28.24-1.856-16.744-2.08-33.28-5.6-49.92-8.536-1.6-0.24-3.256-0.216-4.824-0.608-10.736-2.68-19.456-10.4-31.84-9.84-10.184 0.48-20.704-2.72-30.832-5.28-10.944-2.736-21.6-6.528-32.368-9.952-1.232-0.416-2.24-1.544-3.344-2.32 1.552-0.368 3.096-1.04 4.664-1.12 14.536-0.72 29.096-1.328 40.144-1.824 36.64 1.12 69.712 2.48 102.192 9.92 9.64 2.216 19.304 1.28 28.896-0.88 3.92-0.896 7.92-1.856 11.864-1.76 1.392 0.024 2.848 3 4.056 4.768 0.344 0.512 0.12 1.624-0.144 2.352z m20.56-87.76l-0.08 1.184c-0.272 0.2-0.456 0.44-0.696 0.656-0.112 5.888-0.16 11.76-0.44 17.632-0.056 1.08-1.256 2.128-1.936 3.168-0.424-0.656-1.2-1.344-1.2-2 0.208-6.504-2.432-13.632 3.568-18.816 0-0.424 0.024-0.824 0.032-1.248 0.304-0.184 0.48-0.4 0.752-0.6 0.304-6.056 0.624-12.136 1.008-18.176 0.048-0.736 0.72-1.44 1.12-2.128 0.416 0.512 1.184 1.04 1.184 1.552-0.256 6.4 3.472 13.68-3.312 18.736z m-13.24-97.04c-7.8 34.768-13.656 70-20.136 105.056-1.2 6.32-1 12.96-1.68 19.416-0.576 5.824-4.824 8.936-9.944 7.56-0.768-0.208-1.6-0.352-2.32-0.688-31.92-14.536-66.48-20.584-99.816-30.656-10-3.024-20.56-5.04-31.008-5.76-37.616-2.592-74.496 1.336-110.304 13.96-22.184 7.816-44.584 14.992-66.904 22.4-3.36 1.152-6.2-1.2-6.136-4.96 0.064-3.248-0.032-6.528 0.48-9.72 4.272-26.416 9.224-52.72 12.832-79.176 4.6-33.824 12.216-66.96 20.304-100.032 3.872-15.728 6.56-31.76 9.328-47.72 3.312-19.2 6.8-38.36 8.88-57.68 1.944-17.704 2.48-35.6 2.984-53.464 0.896-30.68-4.696-26.64 27.936-39.344 28.776-11.216 58.384-19.968 88.72-25.376 28.768-5.16 57.976-7.44 87.024-5.8 41.184-2.8 81.184 4.696 121.344 10.384 7.904 1.12 15.52 4.44 23.12 7.232 5.576 2.056 7.472 5.896 6.24 11.544-3.472 15.84-7.096 31.648-10.744 47.416-16.784 71.8-34.032 143.504-50.176 215.44z m55.68-92.768c-1.056-0.96-2.912-1.872-3.016-2.928-0.48-5.28 2.44-9.408 7.76-10.2 1.392-0.24 4.696 2.52 4.608 3.72-0.344 4.64-4.912 8.68-9.36 9.384z m-87.96-26.56c-4.84-2.736-10.272-5.2-15.744-6.08a6443.992 6443.992 0 0 0-98.64-14.8 53.768 53.768 0 0 0-14.6-0.176c-24.104 3.28-48.264 6.36-72.224 10.584-15.224 2.664-29.92 7.728-43.072 16.16-2.64 1.68-5.68 3.96-6.696 6.64-0.96 2.56-0.144 6.352 1.16 8.96 0.816 1.624 4.224 3.24 6.056 2.856 5.52-1.2 10.824-3.28 16.176-5.12 6.88-2.352 13.632-5.232 20.64-7.12 24.384-6.544 49.232-10.376 77.944-9.976 18.856-2.184 40.16 3.64 61.696 7.544 16.752 3.04 33.6 5.576 50.48 7.896 4.68 0.64 9.64-0.064 14.4-0.664 3.48-0.424 7.76-5.544 7.024-8.88-0.64-2.84-2.32-6.448-4.64-7.8z m-30.56 106.24a77.68 77.68 0 0 0-11.744-3.04c-26.4-4.064-52.768-8.296-79.224-11.816-7.952-1.056-16.264-0.68-24.32 0.128-28.176 2.8-56.352 5.92-84.48 9.28-11.24 1.36-22.4 3.664-31.864 10.672-3.472 2.56-5.04 7.12-3.656 10.64 1.376 3.6 5.944 6.56 9.648 5.968 12.768-1.984 25.496-4.48 38.352-6.048 25.68-3.12 51.456-5.76 77.2-8.616 15.52 1.424 30.76 1.264 46.048 4.96 17.264 4.136 35.072 6.136 52.64 9.056 2.376 0.376 4.8 0.64 7.216 0.688 5.68 0.104 11.12-4.96 11.504-10.48 0.344-4.88-2.72-9.92-7.32-11.408z m52.904-218.856c-5.72-2.84-12-5.328-18.28-6.112-37.72-4.72-75.392-10.464-113.664-11.024-21.76 1.88-43.568 3.12-65.232 5.824-16.144 2.032-31.12 8.528-45.504 16.176-0.68 0.376-1.304 0.936-1.96 1.408-4.24 2.928-6.464 9.36-4.096 12.64 2.704 3.72 6.784 4.528 10.856 3.216 5.36-1.76 10.528-4.08 15.736-6.32 12.8-5.472 26.08-8.672 40.08-8.576 56.584 0.344 113.464-4.096 169.296 9.68 3.056 0.72 6.44 0.24 9.64 0.016 3.544-0.256 7.12-4.32 6.768-8.744-0.256-2.904-1.536-7.144-3.624-8.192z m-32.936 171.456a66.4 66.4 0 0 0-9.216-2.624c-11.864-2.64-23.656-5.44-35.56-7.68-24.68-4.64-49.392-8.912-72.352-7.744-40.8-0.912-77.784 7.632-114.504 17.648-4.496 1.224-8.536 4.376-12.52 7.016-1.04 0.68-1.888 3.2-1.424 4.264 0.88 2.016 2.44 4.504 4.32 5.16 6.416 2.28 12.64 0.056 18.96-1.616 29.792-8.032 60.096-12.576 91.008-13.04 14.624-0.24 28.976 0.536 43.296 4.224 21.12 5.424 42.464 10.024 63.816 14.424 7.04 1.44 14.448 1.44 21.68 1.536 4.624 0.024 8.48-4.696 9.12-9.816s-1.96-9.952-6.656-11.776z m13.656-119.168c-7.04-1.92-14.16-3.44-21.28-4.8-7.944-1.52-15.92-3.12-23.936-3.84-20.96-1.896-41.92-4.24-62.936-4.736-17.76-0.4-35.56 1.784-53.36 2.344-20.456 0.64-39.936 6.264-59.392 11.576-6.832 1.856-13.152 6.16-19.2 10.08-2.448 1.584-4.24 4.912-5.2 7.824-0.64 1.92 0.144 5.008 1.44 6.624 1.304 1.6 4 2.344 6.24 2.8 1.4 0.28 3.24-0.4 4.592-1.144 16.608-9.08 34.72-13.44 53.2-15.784 22.48-2.832 44.84-7.92 67.64-5.568 31.36 3.248 62.96 4.664 93.8 11.968a60.96 60.96 0 0 0 11.968 1.632c7.824 0.064 12.592-3.344 13.52-7.68 0.928-4.352-2.272-10.016-7.072-11.328z m-58.96 214.664c-35.6-8.36-72.056-9.776-108.208-13.944-3.92-0.456-8.104 0.136-12.08 0.848-26.24 4.68-52.528 9.384-78.744 14.36-4.68 0.88-9.152 2.944-13.656 4.64-2.48 0.96-2.96 6.544-0.512 8.448 2.456 1.88 5.336 3.92 8.216 4.368 3.92 0.56 8.08 0.048 12.032-0.72 19.056-3.68 38.032-7.72 57.088-11.376 20.88-3.984 41.704-4.28 62.696 0.4 25.256 5.616 50.704 10.224 77.872 15.656-0.264 0 1.384 0.256 2.944-0.056 4.264-0.92 7.784-3.6 8.344-7.728 0.368-2.664-1.2-6.72-3.28-8.376-3.64-2.936-8.184-5.424-12.72-6.48zM443.096 564.48a63.136 63.136 0 0 0-12.6-11.296c-24.192-16.4-49.696-30.4-76.32-42.4-12.768-5.76-25.952-9.072-38.992-7.536-26.112 1.624-51.136 3.16-76.16 4.696a23.744 23.744 0 0 0-2.416 0.256c-4.8 0.8-7.656 6.288-6.16 10.96 2.48 7.76 7.376 12.64 15.68 12.88 13.744 0.336 27.52-0.056 41.296 0.432 9.64 0.344 19.304 1.168 28.84 2.56a140.64 140.64 0 0 1 56.432 21.016c14.96 9.584 29.984 19.12 45.04 28.56 4.08 2.56 8.104 5.6 12.56 6.88 10.704 3.016 19.736-5.36 17.736-16.288a23.92 23.92 0 0 0-4.96-10.72zM242.64 338.584c3.56 1.696 7.56 2.64 11.48 3.32 24.744 4.32 49.392 8.984 73.84 14.832 43.84 10.512 84.664 27.664 121.976 53.08 6.696 4.56 13.792 8.56 20.88 12.504 2.76 1.536 6.048 3.008 9.072 3.008 2.904-0.024 6.44-1.28 8.576-3.2 2.672-2.48 1.536-6.264-0.8-8.64a116.88 116.88 0 0 0-12.776-11.16c-42.88-32.024-90.72-53.28-142.816-65.04-22.104-5.008-44.08-11.104-71.08-10.608-3.256 0.24-10.584 0.4-17.8 1.384-1.656 0.224-4.096 3.16-4.12 4.88-0.064 1.92 1.808 4.776 3.6 5.648zM456.112 504.8c-9.776-7.2-19.648-14.36-30.04-20.616-20.88-12.64-42.4-23.744-67.248-26.576-10.424-1.176-20.672-3.872-31.088-5.24-24.88-3.28-49.776-6.192-69.8-8.64-12.288 0.664-19.56 0.936-26.768 1.6-1.136 0.08-2.696 1.84-3.024 3.072-0.32 1.304 0.16 3.32 1.064 4.344 6.352 7.168 15.472 8.928 24.032 10.288 25.6 4.08 51.28 7.472 76.96 10.64 31.824 3.856 61.944 12.08 88.376 31.12 5.24 3.808 10.784 7.216 16.32 10.616 3.44 2.136 6.992 4.136 10.656 5.8 5.872 2.656 13.168 0.744 14.936-3.616 1.68-4.032 0.384-9.304-4.4-12.816zM265.896 277.824c6.24 1.936 12.456 3.776 18.816 5.08 35.144 7.28 68.76 18.624 100.616 35.44 26.56 14.048 53.92 26.608 77.424 45.84 3.704 3.008 8.376 4.928 12.8 6.88 4.28 1.872 9.64-0.656 12.4-5.144 2.544-4.136 1.6-8.176-1.52-11.024-4.776-4.32-10-8.16-15.36-11.76-33.904-22.664-70.696-40.016-107.536-57.04-27.392-12.696-56.848-18.92-87.264-23.152-1.92 0-4.352-0.144-6.8 0.04-4.128 0.344-7.984 1.392-9.76 5.824-1.12 2.88 1.904 7.68 6.192 9zM240.16 398.336c9.36 2.4 18.824 4.88 28.416 6.04 43.904 5.376 85.016 19.472 124.352 39.144 15.2 7.616 30.016 15.984 44.984 24.032 5.704 3.072 11.248 6.456 17.12 9.216 3.6 1.704 7.616 3.328 11.52 3.496 2.592 0.12 5.896-1.88 7.816-3.92 2.576-2.696 1.472-6.56-1.008-8.72-4.24-3.64-8.824-7.056-13.728-9.72a5987.608 5987.608 0 0 0-68.584-36.608c-19.416-10.24-39.944-17.84-61.04-23.552-23.36-6.336-46.8-13.144-71.464-13.376-5.632 0.4-11.44 0.256-16.896 1.504-2.64 0.6-5.888 3.36-6.824 5.888-1.312 3.568 2.456 5.84 5.336 6.592z'
};
const labelSetting = {
    show: true,
    position: 'right',
    offset: [10, 0],
    fontSize: 16
};
leftBox2Option = {
    title: {
        show: true,
        text: "人均拥有公共图书馆藏量前五名省市",
        textStyle: {
            color: '#fff',
            fontFamily: '楷体',
            fontSize: '1.1rem',
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        },
    },
    grid: {
        containLabel: true,
        left: "0",
    },
    yAxis: {
        data: ['上海', '天津', '浙江', '北京', '江苏'],
        inverse: true,
        axisLine: { show: false },
        axisTick: { show: false },
        axisLabel: {
            margin: 30,
            fontSize: 12
        },
        axisPointer: {
            label: {
                show: true,
                margin: 30
            }
        },
        axisLabel: {
            color: '#fff',
            fontSize: 10,
        },
    },
    xAxis: {
        splitLine: { show: false },
        axisLabel: { show: false },
        axisTick: { show: false },
        axisLine: { show: false },
    },
    series: [
        {
            name: '2020',
            type: 'pictorialBar',
            barGap: '2%',
            label: labelSetting,
            symbolRepeat: true,
            symbolSize: ["60%","60%"],
            data: [
                {
                    value: 3.25,
                    symbol: pathSymbols.book
                },
                {
                    value: 1.57,
                    symbol: pathSymbols.book
                },
                {
                    value: 1.53,
                    symbol: pathSymbols.book
                },
                {
                    value: 1.43,
                    symbol: pathSymbols.book
                },
                {
                    value: 1.32,
                    symbol: pathSymbols.book
                }
            ]
        }
    ]
};

leftBox2Option && leftBox2MyChart.setOption(leftBox2Option);

window.onresize = function () {
    leftBox2MyChart.resize();
};
/* title */
let titleBoxChart = document.getElementById('title');
let titleBoxMyChart = echarts.init(titleBoxChart);
let titleBoxOption;
titleBoxOption = {
    graphic: {
        elements: [
            {
                type: 'text',
                left: 'center',
                top: 'center',
                style: {
                    text: '全国公共图书馆发展情况',
                    fontSize: '2rem',
                    fontWeight: 'bold',
                    fontFamily: '楷体',
                    lineDash: [0, 200],
                    lineDashOffset: 0,
                    fill: '#F3EFCB',
                    stroke: '#000',
                    lineWidth: 1,
                },
            }
        ]
    }
};
titleBoxOption && titleBoxMyChart.setOption(titleBoxOption);
window.onresize = function () {
    titleBoxMyChart.resize();
};
/* main-box */
let mainBoxChart = document.getElementById('main-box');
let MainBoxMyChart = echarts.init(mainBoxChart);
let mainBoxOption;

MainBoxMyChart.showLoading();
$.getJSON('./data/china.json', function (chinaJson) { // data/china.json
    MainBoxMyChart.hideLoading();
    echarts.registerMap('China', chinaJson);
    let data = [
        { name: '北京', value: 180.27 },
        { name: '天津', value: 115.79 },
        { name: '河北', value: 192.86 },
        { name: '山西', value: 191.27 },
        { name: '内蒙古', value: 81.1 },
        { name: '辽宁', value: 230.45 },
        { name: '吉林', value: 106.91 },
        { name: '黑龙江', value: 91.78 },
        { name: '上海', value: 555.26 },
        { name: '江苏', value: 2848.55 },
        { name: '浙江', value: 717.63 },
        { name: '安徽', value: 296.49 },
        { name: '福建', value: 230.89 },
        { name: '江西', value: 189.16 },
        { name: '山东', value: 702.57 },
        { name: '河南', value: 228.55 },
        { name: '湖北', value: 263.96 },
        { name: '湖南', value: 256.64 },
        { name: '广东', value: 935.5 },
        { name: '广西', value: 164.47 },
        { name: '海南', value: 33.58 },
        { name: '重庆', value: 280.4 },
        { name: '四川', value: 469.14 },
        { name: '贵州', value: 90.49 },
        { name: '云南', value: 65.67 },
        { name: '西藏', value: 1.65 },
        { name: '陕西', value: 72.43 },
        { name: '甘肃', value: 56.74 },
        { name: '青海', value: 18.44 },
        { name: '宁夏', value: 33.32 },
        { name: '新疆', value: 56.23 },
    ];
    data.sort(function (a, b) {
        return a.value - b.value;
    });
    const mapOption = {
        title: {
            show: true,
            text: "公共图书馆累计发放有效借书证数全国分布(万人)",
            textStyle: {
                color: '#fff',
                fontFamily: '楷体',
                fontSize: '1.5rem',
            }
        },
        tooltip: {
            trigger: 'item',
            formatter: function(data){
                // console.log(data);
                return data.name + ": " + data.value + "万人";
            },
            color: '#fff',
        },
        visualMap: {
            left: 'right',
            min: 50,
            max: 250,
            inRange: {
                // prettier-ignore
                color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
            },
            text: ['High', 'Low'],
            calculable: true,
            textStyle: {
                color: '#ffffff'
            },
        },
        series: [
            {
                type: 'map',
                roam: true,
                map: 'China',
                animationDurationUpdate: 1000,
                universalTransition: true,
                data: data
            }
        ]
    };
    const barOption = {
        title: {
            show: true,
            text: "公共图书馆累计发放有效借书证数(万个)",
            textStyle: {
                color: '#fff',
                fontFamily: '楷体',
                fontSize: '1.5rem',
            }
        },
        tooltip: {
            trigger: 'item',
            formatter: function (data) {
                // console.log(data);
                return data.name + ": " + data.value + "万人";
            }
        },
        xAxis: {
            type: 'value',
            axisLabel: {
                color: '#fff',
                fontSize: 10,
            },
        },
        yAxis: {
            type: 'category',
            data: data.map(function (item) {
                return item.name;
            }),
            axisLabel: {
                rotate: 30,
                color: '#fff',
                fontSize: 10,
            },
        },
        dataZoom: [
            {
                type: 'inside',
                orient: 'vertical',
            },
        ],
        animationDurationUpdate: 1000,
        series: {
            type: 'bar',
            id: 'population',
            data: data.map(function (item) {
                return item.value;
            }),
            universalTransition: true,
            itemStyle: {
                normal: {
                    color: function (params) {
                        // console.log(params);
                        let colorList = ['#faad39', '#66d99c', '#2f9bf1', '#64b8f9'];
                        return colorList[params.dataIndex % 4];
                    },
                    offset: 0.5,
                    // 初始化 柱形图圆角
                    barBorderRadius: [4, 4, 4, 4]
                }
            },
            emphasis: {
                itemStyle: {
                    normal: {
                        color: function (params) {
                            // console.log(params);
                            let colorList = ['#faad39', '#66d99c', '#2f9bf1', '#64b8f9'];
                            return colorList[params.dataIndex];
                        },
                        offset: 0.7,
                        // 初始化 柱形图圆角
                        barBorderRadius: [4, 4, 4, 4]
                    }
                },
            },
        }
    };
    let currentOption = mapOption;
    MainBoxMyChart.setOption(mapOption);
    //双击切换option
    let g_clickTime = null;
    let g_TimeFn = null;
    let g_onItemName = '';
    mainBoxChart.onclick = function (params) {
        let myDate = new Date();
        if (g_clickTime === null) {
            // 第一次点击
            g_clickTime = myDate.getMilliseconds(); // 返回时间的毫秒。
            g_onItemName = params.name;
            // 起一个定时器，进行重置
            g_TimeFn = setTimeout(function () {
                // 单击要执行的代码
                g_clickTime = null;
            }, 300);
        } else {
            clearTimeout(g_TimeFn);
            // 第二次点击
            if (Math.abs(myDate.getMilliseconds() - g_clickTime) < 300 && g_onItemName === params.name) {
                // 双击操作
                console.log(params);
                currentOption = currentOption === mapOption ? barOption : mapOption;
                MainBoxMyChart.setOption(currentOption, true);
            }
            g_clickTime = null;
        }
    }; 
    // mainBoxChart.ondblclick = function () {
    //     currentOption = currentOption === mapOption ? barOption : mapOption;
    //     MainBoxMyChart.setOption(currentOption, true);
    // };
    // setInterval(function() {
    //     MainBoxMyChart.setOption(mapOption, true);
    // }, 10000);
});

mainBoxOption && MainBoxMyChart.setOption(mainBoxOption);
window.onresize = function () {
    MainBoxMyChart.resize();
};

/* right-box1 */
let rightBox1Rom = document.getElementById('right-box1')
let rightBox1MyChart = echarts.init(rightBox1Rom);
let rightBox1Option;
rightBox1Option = {
    title: {
        show: true,
        text: "总藏书量占比(省)",
        textStyle: {
            color: '#fff',
            fontFamily: '楷体',
            fontSize: '1.5rem',
        }
    },
    tooltip: {
        trigger: 'item',
        formatter: function (data) {
            let k = eval(data.value.toFixed(3));
            let t = k*100;
            return t.toFixed(2) + "%";
        }
    },
    series: [
        {
            // name: 'Access From',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            itemStyle: {
                borderRadius: 10,
                borderColor: '#fff',
                borderWidth: 2
            },
            label: {
                show: false,
                position: 'center',
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '40',
                    fontWeight: 'bold',
                }
            },
            labelLine: {
                show: false
            },
            data: [
                { name: '北京市', value: 0.027526222740224 },
                { name: '天津市', value: 0.0191098364894452 },
                { name: '河北省', value: 0.0301550640337488 },
                { name: '山西省', value: 0.0189144437003001 },
                { name: '内蒙古自治区', value: 0.0180069742222967 },
                { name: '辽宁省', value: 0.0398269192399607 },
                { name: '吉林省', value: 0.0198393087593516 },
                { name: '黑龙江省', value: 0.0207036407106148 },
                { name: '上海市', value: 0.0710912590631636 },
                { name: '江苏省', value: 0.0926555417533041 },
                { name: '浙江省', value: 0.0866914052914722 },
                { name: '安徽省', value: 0.0311522349675603 },
                { name: '福建省', value: 0.040469501461097 },
                { name: '江西省', value: 0.0251006813181387 },
                { name: '山东省', value: 0.0612840170367752 },
                { name: '河南省', value: 0.035716290724439 },
                { name: '湖北省', value: 0.0387982956899109 },
                { name: '湖南省', value: 0.0344640724583936 },
                { name: '广东省', value: 0.102680755681612 },
                { name: '广西壮族自治区', value: 0.0263838250616028 },
                { name: '海南省', value: 0.00584526665800402 },
                { name: '重庆市', value: 0.0175492420139128 },
                { name: '四川省', value: 0.0382216936776991 },
                { name: '贵州省', value: 0.0147035709525776 },
                { name: '云南省', value: 0.0205937322667206 },
                { name: '西藏自治区', value: 0.00218885609206866 },
                { name: '陕西省', value: 0.0189353535401457 },
                { name: '甘肃省', value: 0.015936900077586 },
                { name: '青海省', value: 0.00511228012930012 },
                { name: '宁夏回族自治区', value: 0.00705232669850058 },
                { name: '新疆维吾尔自治区', value: 0.0132904874900733 },
            ]
        }
    ]
};

rightBox1Option && rightBox1MyChart.setOption(rightBox1Option);

window.onresize = function () {
    rightBox1MyChart.resize();
};

/* right-box2 */
let rightBox2Rom = document.getElementById('right-box2')
let rightBox2MyChart = echarts.init(rightBox2Rom);
let rightBox2Option;

let dataAxis = ["广东","浙江","江苏","福建","山东","河南","湖南","安徽","湖北","上海","辽宁","四川","河北","江西","重庆","北京","天津","广西","云南","山西","陕西","黑龙江","内蒙古","甘肃","吉林","贵州","新疆","宁夏","海南","青海","西藏",];
let data = [7932.52,7846.38,6153.31,4176.47,3623.42,2465.4,2409.03,2339.7,2297.59,2151.19,1981.58,1929.03,1713.5,1688.28,1323.85,1266.14,1066.71,1060.81,1055.93,1044.37,1002.88,883.97,784.47,714.76,710.3,641.67,362.3,353.89,228.05,92.78,10.73,];
let yMax = 500;
let dataShadow = [];
for (let i = 0; i < data.length; i++) {
    dataShadow.push(yMax);
}
rightBox2Option = {
    title: {
        text: '书刊文献外借册次统计(万册次)',
        textStyle: {
            color: '#fff',
            fontFamily: '楷体',
            fontSize: '1.3rem',
        }
    },
    tooltip: {
        trigger: 'item',
    },
    grid: {
        containLabel: true
    },
    xAxis: {
        data: dataAxis,
        axisLabel: {
            outside: true,
            color: '#fff'
        },
        axisTick: {
            show: false
        },
        axisLine: {
            show: false
        },
        z: 10
    },
    yAxis: {
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            color: '#fff',
            rotate: 30,
            fontSize: 10,
        },
    },
    dataZoom: [
        {
            type: 'inside'
        }
    ],
    series: [
        {
            type: 'bar',
            showBackground: true,
            itemStyle: {
                normal: {
                    color: function (params) {
                        // console.log(params);
                        let colorList = ['#faad39', '#66d99c', '#2f9bf1', '#64b8f9'];
                        return colorList[params.dataIndex%4];
                    },
                    offset: 0.5,
                    // 初始化 柱形图圆角
                    barBorderRadius: [4, 4, 4, 4]
                }
            },
            emphasis: {
                itemStyle: {
                    normal: {
                        color: function (params) {
                            // console.log(params);
                            let colorList = ['#faad39', '#66d99c', '#2f9bf1', '#64b8f9'];
                            return colorList[params.dataIndex];
                        },
                        offset: 0.7,
                        // 初始化 柱形图圆角
                        barBorderRadius: [4, 4, 4, 4]
                    }
                },
            },
            data: data
        }
    ]
};
const zoomSize = 6;
rightBox2MyChart.on('click', function (params) {
    // console.log(dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)]);
    rightBox2MyChart.dispatchAction({
        type: 'dataZoom',
        startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)],
        endValue:
            dataAxis[Math.min(params.dataIndex + zoomSize / 2, data.length - 1)]
    });
});

rightBox2Option && rightBox2MyChart.setOption(rightBox2Option);

window.onresize = function () {
    rightBox2MyChart.resize();
};